﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="call.aspx.cs" Inherits="call" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
    #container
    {
        width: 100%;
    }

    #left
    {
        float: left;
        width: 73%;
    }

    #right
    {
        float: right;
        width: 25%;
    }

    #call-info
    {
        font-size: 1.2em;
    }

    #greeting
    {
        font-size: 1.3em;
    }

    #instructions
    {
        clear: both;
    }
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:HiddenField ID="hfCallID" runat="server" />
    <div id="container">
        <div id="left">
            <div id="call-info" class="div-box">
                <table width="100%">
                    <tr>
                        <td style="text-align:left">Caller:<asp:Label ID="lbCallerInfo" runat="server" Text="Information not available" /></td>
                        <td style="text-align:right">Client:<asp:Label ID="lbClientInfo" runat="server" />&nbsp;<asp:HyperLink ID="lkClientMessages" runat="server" Target="_blank" /></td>
                    </tr>
                </table>
            </div>
            <div id="greeting" class="div-box">
                <asp:Label ID="lbGreeting" runat="server" />
            </div>
            <div id="scratchpad" class="div-box">
                <asp:Label ID="lbScratchpad" runat="server" />
                <asp:ImageButton ID="btEditScratchpad" runat="server" CausesValidation="false"  ImageUrl="~/images/edit.gif" />                
                <ajax:modalpopupextender ID="mpEditScratchpad" runat="server" 
                    PopupControlID="pnEditScratchpad" TargetControlID="btEditScratchpad" BackgroundCssClass="modalBackground" />
            </div>
            <asp:Panel ID="pnEditScratchpad" runat="server" Style="display:none">
                <div style="background-color:#CCCCFF; border: solid 1px black; width:300px;">
                    <p style="text-align:center">Edit Scratchpad</p>
                    <asp:TextBox ID="tbEditScratchpad" runat="server" TextMode="MultiLine" Width="97%" />
                    <asp:ImageButton ID="btUpdateScratchpad" runat="server" CausesValidation="false" ImageUrl="~/images/update.gif" OnClick="btUpdateScratchpad_Click" />
                    &nbsp;<asp:ImageButton ID="btCancelEditAScratchpad" runat="server" ImageUrl="~/images/cancel.gif" />                    
                </div>
            </asp:Panel>
            <div id="instructions" class="div-box">
                <asp:Label ID="lbInstructions" runat="server" />
            </div>
            <div id="specific-instructions" class="div-box">
                <asp:DropDownList ID="ddSpecificInstructions" runat="server" Visible="false" AutoPostBack="true" OnSelectedIndexChanged="ddSpecificInstructions_SelectedIndexChanged" />
                <asp:Label ID="lbSpecificInstructions" runat="server" />
            </div>
            <div id="message-input" class="div-box">
                <table width="100%">
                    <tr>
                        <td>
                            <span>Caller Name:</span><asp:TextBox ID="tbCallerName" runat="server" Width="97%" />
                            <asp:RequiredFieldValidator ID="rfCallerName" runat="server" ControlToValidate="tbCallerName" ValidationGroup="vgMessage" />
                        </td>
                        <td>
                            <span>CallerNumber:</span><ew:NumericBox ID="tbCallerNumber" runat="server" Width="97%" MaxLength="10" DecimalPlaces="0" />
                            <asp:RequiredFieldValidator ID="rfCallerNumber" runat="server" ControlToValidate="tbCallerNumber" ValidationGroup="vgMessage" />
                        </td>
                        <td colspan="2">
                            <span>Caller Address:</span><asp:TextBox ID="tbCallerAddress" runat="server" Width="97%" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <asp:TextBox ID="tbMessage" runat="server" TextMode="MultiLine" Width="99%" Height="100px" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="CustomText1_Label" runat="server" CssClass="custom-label" Visible="false" /><br />
                            <asp:TextBox ID="CustomText1" runat="server" CssClass="custom-field" Visible="false" />
                        </td>
                        <td>
                            <asp:Label ID="CustomDateTime1_Label" runat="server" CssClass="custom-label" Visible="false" /><br />
                            <asp:TextBox ID="CustomDateTime1" runat="server" CssClass="custom-field" Visible="false" />
                            <ajax:CalendarExtender ID="ceCustomDateTime1" runat="server" TargetControlID="CustomDateTime1" />
                        </td>
                        <td>
                            <asp:Label ID="CustomNumeric1_Label" runat="server" CssClass="custom-label" Visible="false" /><br />
                            <ew:NumericBox ID="CustomNumeric1" runat="server" CssClass="custom-field" Visible="false" />
                        </td>
                        <td>
                            <asp:Label ID="CustomBit1_Label" runat="server" CssClass="custom-label" Visible="false" />
                            <asp:CheckBox ID="CustomBit1" runat="server" CssClass="custom-field" Visible="false" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="CustomText2_Label" runat="server" CssClass="custom-label" Visible="false" /><br />
                            <asp:TextBox ID="CustomText2" runat="server" CssClass="custom-field" Visible="false" />
                        </td>
                        <td>
                            <asp:Label ID="CustomDateTime2_Label" runat="server" CssClass="custom-label" Visible="false" /><br />
                            <asp:TextBox ID="CustomDateTime2" runat="server" CssClass="custom-field" Visible="false" />
                            <ajax:CalendarExtender ID="ceCustomDateTime2" runat="server" TargetControlID="CustomDateTime2" />
                        </td>
                        <td>
                            <asp:Label ID="CustomNumeric2_Label" runat="server" CssClass="custom-label" Visible="false" /><br />
                            <ew:NumericBox ID="CustomNumeric2" runat="server" CssClass="custom-field" Visible="false" />
                        </td>
                        <td>
                            <asp:Label ID="CustomBit2_Label" runat="server" CssClass="custom-label" Visible="false" />
                            <asp:CheckBox ID="CustomBit2" runat="server" CssClass="custom-field" Visible="false" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="CustomText3_Label" runat="server" CssClass="custom-label" Visible="false" /><br />
                            <asp:TextBox ID="CustomText3" runat="server" CssClass="custom-field" Visible="false" />
                        </td>
                        <td>
                            <asp:Label ID="CustomDateTime3_Label" runat="server" CssClass="custom-label" Visible="false" /><br />
                            <asp:TextBox ID="CustomDateTime3" runat="server" CssClass="custom-field" Visible="false" />
                            <ajax:CalendarExtender ID="ceCustomDateTime3" runat="server" TargetControlID="CustomDateTime3" />
                        </td>
                        <td>
                            <asp:Label ID="CustomNumeric3_Label" runat="server" CssClass="custom-label" Visible="false" /><br />
                            <ew:NumericBox ID="CustomNumeric3" runat="server" CssClass="custom-field" Visible="false" />
                        </td>
                        <td>
                            <asp:Label ID="CustomBit3_Label" runat="server" CssClass="custom-label" Visible="false" />
                            <asp:CheckBox ID="CustomBit3" runat="server" CssClass="custom-field" Visible="false" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <asp:ValidationSummary ID="vsMessage" runat="server" ValidationGroup="vgMessage" />
                        </td>
                    </tr>
                </table>
            </div>
            <div id="message-delivery" class="div-box">
                <table width="100%" cellpadding="0" cellspacing="0" border="1">
                    <tr align="center">
                        <td style="width:20%">Email</td>
                        <td style="width:20%">Fax</td>
                        <td style="width:20%">SMS</td>
                        <td style="width:20%">Alpha</td>
                        <td style="width:20%">Numeric</td>
                    </tr>
                    <tr align="center">
                        <td><asp:CheckBoxList ID="cbEmail" runat="server" /></td>
                        <td><asp:CheckBoxList ID="cbFax" runat="server" /></td>
                        <td><asp:CheckBoxList ID="cbSMS" runat="server" /></td>
                        <td><asp:CheckBoxList ID="cbAlpha" runat="server" /></td>
                        <td><asp:CheckBoxList ID="cbNumeric" runat="server" /></td>
                    </tr>
                </table>
                <p style="text-align:center">
                    <asp:Button ID="btSendMessage" runat="server" Text="send message now" OnClick="btSendMessage_Click" />
                    <asp:Button ID="btQueueMessage" runat="server" Text="queue message" OnClick="btQueueMessage_Click" />
                    <asp:Button ID="btPark" runat="server" Text="Park Call" OnClick="btPark_Click" />
                    <asp:Button ID="btCloseNoBill" runat="server" Text="Close(No Bill)" OnClick="btCloseNoBill_Click" />
                </p>
            </div>            
        </div>
        <div id="right">
            <div id="call-action" class="div-box">
                <span>Speed Dial</span><br />
                <asp:ListView ID="lvNumbers" runat="server">
                    <LayoutTemplate>
                        <table runat="server">
                            <tr ID="itemplaceholder" runat="server" />
                        </table>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <tr runat="server">
                            <td>
                                <asp:LinkButton ID="btNumber" runat="server" Text='<%# Eval("Description").ToString() + " " + Eval("Number1").ToString() %>' OnCommand="PhoneLink_Click" CommandName='<%#Eval("Number1") %>' />
                            </td>
                        </tr>                        
                    </ItemTemplate>
                </asp:ListView><br />
                <asp:LinkButton ID="lkVoiceMail" runat="server" Text="Fwd to Voicemail" OnClick="btVoicemail_Click" /><br /><br />
                <span>Website</span><br />
                <asp:Hyperlink ID="lkWebsite" runat="server" />
            </div>
            <div class="div-box">
                <table width="100%">
                    <tr>
                        <td>Special Functions</td>
                        <td align="right"><asp:ImageButton ID="btNewActionTaken" runat="server" CausesValidation="false"  ImageUrl="~/images/add.gif" /></td>
                    </tr>
                    </table>
                <asp:ListView ID="lvActionsTaken" runat="server" OnDataBinding="lvActionsTaken_DataBinding">
                    <LayoutTemplate>
                        <table width="100%">
                            <tr ID="itemplaceholder" runat="server" />
                        </table>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <tr runat="server">
                            <td>
                                <asp:Label ID="lbDescription" runat="server" Text='<%# Eval("Action.Description") %>'  />
                            </td>
                            <td>
                                <asp:Label ID="lbTimestamp" runat="server" Text='<%# Eval("Timestamp") %>' />
                            </td>
                        </tr>                        
                    </ItemTemplate>
                </asp:ListView>
                <ajax:modalpopupextender ID="mpNewActionTaken" runat="server" PopupControlID="pnNewActionTaken" TargetControlID="btNewActionTaken" CancelControlID="btCancelActionTaken"  />
                <asp:Panel ID="pnNewActionTaken" runat="server" Style="display:none">
                    <div style="background-color:#CCCCFF; border: solid 1px black; padding:8px;">
                        <asp:ListView ID="dlActions" runat="server" DataSourceID="dsActions" DataKeyField="ActionID">
                            <LayoutTemplate>
                                <table width="100%">
                                    <tr ID="itemPlaceholder" runat="server" />
                                </table>
                            </LayoutTemplate>
                            <ItemTemplate>
                                <tr runat="server">
                                    <td><asp:Button ID="btChooseAction" runat="server" Font-Size="1.1em" Font-Bold="true" Width="100px" Text='<%# Eval("Description") %>' CommandName='<%# Eval("ActionID") %>' OnCommand="btChooseAction_Command" /></td>
                                </tr>
                            </ItemTemplate>
                        </asp:ListView>
                        <table width="100%">
                            <tr>
                                <td align="right"><asp:ImageButton ID="btCancelActionTaken" runat="server" ImageUrl="~/images/cancel.gif" /></td>
                            </tr>                        
                        </table>
                        <asp:LinqDataSource ID="dsActions" runat="server" ContextTypeName="AnsweringServiceDataContext" TableName="Actions" />
                    </div>
                </asp:Panel>
             </div>
            <div class="div-box">
                <table width="100%">
                    <tr>
                        <td>Follow Up</td>
                        <td align="right"><asp:ImageButton ID="btNewFollowUp" runat="server" ImageUrl="~/images/add.gif" /></td>
                    </tr>
                </table>
                <asp:ListView ID="lvFollowUps" runat="server" OnDataBinding="lvFollowUps_DataBinding">
                    <LayoutTemplate>
                        <table width="100%">
                            <tr ID="itemPlaceholder" runat="server" />
                        </table>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <tr runat="server">
                            <td><%# Eval("Reminder") %></td>
                            <td><%# Eval("Note") %></td>
                        </tr>
                    </ItemTemplate>
                </asp:ListView>
                <ajax:modalpopupextender ID="mpFollowUp" runat="server" PopupControlID="pnFollowUp" TargetControlID="btNewFollowUp" CancelControlID="btCancelFollowUp"  />
                <asp:Panel ID="pnFollowUp" runat="server" Style="display:none">
                    <div style="background-color:#CCCCFF; border: solid 1px black; width:300px;">
                        <asp:TextBox ID="tbFollowUpNote" runat="server" />
                        <asp:ImageButton ID="btAddFollowUp" runat="server" ImageUrl="~/images/update.gif" OnClick="btAddFollowUp_Click" />
                        &nbsp;<asp:ImageButton ID="btCancelFollowUp" runat="server" ImageUrl="~/images/cancel.gif" />                    
                    </div>
                </asp:Panel>                
            </div>
            <div id="on-call" class="div-box">
                <asp:PlaceHolder ID="OnCallPlaceHolder" runat="server"></asp:PlaceHolder>
                <asp:ListView ID="lvOnCall" runat="server" OnDataBinding="lvOnCall_DataBinding">
                    <LayoutTemplate>
                        <table>
                            <tr ID="itemPlaceholder" runat="server" />
                        </table>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <tr>
                            <td><%# Eval("Note") %></td>
                        </tr>
                    </ItemTemplate>
                </asp:ListView>
            </div>
        </div>
    </div>
</asp:Content>
